<template>
	<view class="zuipageWrap uni-common-pb">
		<view class="page-section swiper">
			<view class="page-section-spacing">
				<swiper class="swiper" indicator-dots="true" autoplay="true" interval="5000" duration="500" circular="true">
					<swiper-item v-for="v in banner" :key="v.pictureId">
						<view class="swiper-item">
							<image :src="v.csrc" class="J_bannerImg"></image>
						</view>
					</swiper-item>
				</swiper>
			</view>
		</view>
		<view class="uni-grid-9 zgrid">
			<view class="uni-grid-9-item" v-for="v in zmenu" :key="v.tit" @tap="setRouter(v)">
				<image :src="v.csrc" class="zgrid_img"></image>
				<p class="tit">{{v.tit}}</p>
			</view>
		</view>
		
		<view class="J_footer">
			<view class="J_copyright">院内物流</view>
		</view>
	</view>
</template>

<script>
import uniGrid from "@/components/uni-grid/uni-grid.vue"

import {
	mapState,mapGetters,mapMutations,mapActions
} from 'vuex'

export default {
	components: {uniGrid},
	data() {
		return {
			banner: [
				{
					csrc: "/static/home/banner1.jpg",
					pictureId: "1",
				},
				{
					csrc: "/static/home/banner2.jpg",
					pictureId: "2",
				},
			],
			zmenu: [
				{
					csrc: "/static/home/8.png",
					tit: "发票复核",
					target: '../invoice/index'
				},
				{
					csrc: "/static/home/9.png",
					tit: "验收复核",
					target: '../medcheck/index'
				},
				{
					csrc: "/static/home/6.png",
					tit: "验收结果",
					target: '../checkres/list'
				},
				{
					csrc: "/static/home/1.png",
					tit: "盘点计划",
					target: '../inventoryplan/list'
				},
				{
					csrc: "/static/home/4.png",
					tit: "盘点",
					target: '../inventory/index'
				},
				{
					csrc: "/static/home/4.png",
					tit: "盘点(贵重)",
					target: '../inventorygz/index'
				},
				{
					csrc: "/static/home/10.png",
					tit: "批号调整",
					target: '../batchreset/index'
				},
				{
					csrc: "/static/home/7.png",
					tit: "质量状态",
					target: '../qualityreset/index'
				},
				{
					csrc: "/static/home/2.png",
					tit: "监管码",
					target: '../supervisory/index'
				},
				{
					csrc: "/static/home/3.png",
					tit: "药品调配",
					target: '../drugDispensing/index'
				},
				/* {
					csrc: "/static/home/5.png",
					tit: "药品下架",
					target: '../supervisory/index'
				}, */
				{
					csrc: "/static/home/11.png",
					tit: "药品上架",
					target: '../drugIn/index'
				},
				{
					csrc: "/static/home/5.png",
					tit: "药品下架",
					target: '../drugOut/index'
				},
				{
					csrc: "/static/home/12.png",
					tit: "领料入库",
					target: '../materialIn/index'
				},
				{
					csrc: "/static/home/13.png",
					tit: "领料出库",
					target: '../materialOut/index'
				},
				{
					csrc: "/static/home/14.png",
					tit: "类别码对照",
					target: '../categorycode/index'
				},
				{
					csrc: "/static/home/15.png",
					tit: "库内调拨",
					target: '../allocation/index'
				},
				{
					csrc: "/static/home/16.png",
					tit: "采购流程",
					target: '../process/index'
				},
				{
					csrc: "/static/home/17.png",
					tit: "统领单",
					target: '../hospMedOut/index'
				}
			]
		}
	},
	onLoad() {
		
	},
	onNavigationBarButtonTap(e) {
		let _that = this;
		this.zutil.zconfirm("确认退出吗？", (type)=>{
			if(type){
				// 确定
				_that.w_setPid(null);
				uni.reLaunch({
					url: '/pages/login/index'
				});
			}else{
				// 取消
			}
		});
	},
	methods: {
		...mapMutations(['w_setPid']),
		setRouter (data) {
			if(data.target){
				if(data.target == 'zuiNotDone'){
					this.zutil.ztip("即将开放，敬请期待...");
				}else{
					uni.navigateTo({
						url: data.target+"?tit="+data.tit
					});
				}
			}
		},
	}
}
</script>

<style scoped lang="scss">
.content {
	text-align: center;
	height: 400upx;
}

.logo {
	height: 200upx;
	width: 200upx;
	margin-top: 200upx;
}

.title {
	font-size: 36upx;
	color: #8f8f94;
}
.swiper {
	width: 100%;
	height: 320upx;
	.J_bannerImg {
		width: 100%;
		height: 320upx;
	}
}
.zgrid {
	background: #fff;
	padding-bottom: 24upx;
	.uni-grid-9-item {
		width: 33.3333%;
		width: 25%;
		height: 190upx;
		text-align: center;
		line-height: 182upx;
		position: relative;
		border: 0;
		.zgrid_img {
			width: 96upx;
			height: 96upx;
			display: block;
			margin-top: -34upx;
		}
		.tit {
			height: 34upx;
			line-height: 34upx;
			position: absolute;
			left: 0;
			right: 0;
			bottom: 4upx;
		}
	}
}

.J_footer {
	text-align: center;
	position: fixed;
	left: 0;
	right: 0;
	bottom: 10px;
	
	.J_copyright {
		position: relative;
		width: 100%;
		&:before, &:after {
			content: '';
			width: 26%;
			height: 1px;
			background: rgba(0, 0, 0, 0.16);
			position: absolute;
			top: 12px;
		}
		&:before {
			left: 7%;
		}
		&:after {
			right: 7%;
		}
	}
}
</style>
